Page({
  data: {
    project: {},
    volunteerList:[{}]
  },

  onLoad(e) {
    console.log(e)
    wx.cloud.database().collection("project").doc(e.id)
      .get()
      .then(res => {
        console.log("获取项目成功", res)
        let startYear = new Date(res.data.startDateStamp).getFullYear()
        let startMonth = new Date(res.data.startDateStamp).getMonth() + 1
        let startDate = new Date(res.data.startDateStamp).getDate()
        let endYear = new Date(res.data.endDateStamp).getFullYear()
        let endMonth = new Date(res.data.endDateStamp).getMonth() + 1
        let endDate = new Date(res.data.endDateStamp).getDate()
        this.setData({
          project: res.data,
          startYear: startYear,
          startMonth: startMonth,
          startDate: startDate,
          endYear: endYear,
          endMonth: endMonth,
          endDate: endDate,
          startTime: res.data.startTime,
          endTime: res.data.endTime,
          volunteerList:res.data.vlnListNotAdmit
        })

      })
      .catch(err => {
        console.log("获取项目失败", err)
      })
  },

})